<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
     xmlns:a="http://xmlns.jcp.org/jsf/passthrough"
     template="../TemplateFrontEnd.xhtml">
<ui:define name="title">Sign In</ui:define>
<ui:define name="body" >

<div class="container">

<h:form id="formlogin" name="formlogin" >
  <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />

    <p:panel id="basic"   > 
          
           <h:panelGrid columns="1" cellpadding="5" style="width:41%;clear: both;margin: auto;">
            
            <p:inputText id="username" value="#{loginnMB.employe.username}"  label="username"  />
            <p:watermark for="username" value="Enter username "  />
            
           
            <p:password id="password" value="#{loginnMB.employe.password}"  label="password" />
            <p:watermark for="password" value="Enter password"  />
            
            
            
        <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
      
        <p:selectBooleanCheckbox value="#{loginnMB.remember}" />
          <h:outputText value="Remember me" />
        </h:panelGrid>
        <p:commandButton ajax="false" value="Sign In" update="growl" actionListener="#{loginnMB.action(1)}" />
                                 
          
            
            <f:facet name="header" >
             <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
             <p:outputLabel value="Sign In" />
              <h:link style="color:blue;" value="As Client" outcome="login" />    
              </h:panelGrid>        
            </f:facet> 
        </h:panelGrid>
    </p:panel>
    </h:form>
</div>

<script type="text/javascript">
    function handleLoginRequest(xhr, status, args) {
        if(args.validationFailed || !args.loggedIn) {
            #formlogin.jq.effect("shake", {times:5}, 100);
        }
        else {
            #formlogin.hide();
            $('#loginLink').fadeOut();
        }
    }
</script>
</ui:define>
</ui:composition>